Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new parametric OpenSCAD script for generating customizable USB/SD/microSD storage rack plates with standard rack mounting holes. The design supports configurable rack dimensions (10" or 6" width), flexible storage slot arrangements with three positioning zones (left/middle/right), and optional structural reinforcement ribs.
Key Changes:
- Adds complete plate generation system with rounded corners and mounting holes
- Implements configurable storage slots with stacking options and safety stops
- Includes structural rib support with chamfered edges for rack mounting compatibility
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| module chamfered_rib(width, thickness, depth, chamfer) { | ||
| difference() { | ||
| cube([width, thickness, depth]); | ||
| translate([depth - depth * 2, -tolerance, depth]) |
There was a problem hiding this comment.
The expression depth - depth * 2 simplifies to -depth, which creates a negative X translation. This will incorrectly position the chamfer cube. Consider replacing with the intended expression, likely just -depth or adjusting the calculation based on the desired geometry.
| translate([depth - depth * 2, -tolerance, depth]) | |
| translate([-depth, -tolerance, depth]) |
| translate([depth - depth * 2, -tolerance, depth]) | ||
| rotate([0, 45, 0]) | ||
| cube([depth * 1.5, thickness + 2*tolerance, depth * 1.5]); | ||
| translate([width - depth + depth, -tolerance, 0]) |
There was a problem hiding this comment.
The expression width - depth + depth simplifies to just width, making the -depth + depth portion redundant. This should be simplified to translate([width, -tolerance, 0]) or corrected if a different offset was intended.
| translate([width - depth + depth, -tolerance, 0]) | |
| translate([width, -tolerance, 0]) |
| } | ||
|
|
||
| module structural_ribs() { | ||
| usable_width = (rack_width == 152.4) ? 120.65 * 0.9 : 221.5 * 0.9; |
There was a problem hiding this comment.
Magic numbers for rack specifications are scattered across multiple functions. Consider extracting these values into named constants at the top of the file (e.g., rack_6inch_usable_width, rack_10inch_hole_spacing) to improve maintainability and reduce duplication.
| hole_spacing_x = (rack_width == 152.4) ? 136.526 : 236.525; | ||
| hole_left_x = (rack_width - hole_spacing_x) / 2; | ||
| hole_right_x = (rack_width + hole_spacing_x) / 2; | ||
| slot_len = (rack_width == 152.4) ? 6.5 : 10.0; | ||
| slot_height = (rack_width == 152.4) ? 3.25 : 7.0; |
There was a problem hiding this comment.
Magic numbers for rack specifications are scattered across multiple functions. Consider extracting these values into named constants at the top of the file (e.g., rack_6inch_usable_width, rack_10inch_hole_spacing) to improve maintainability and reduce duplication.
| translate([x_pos, y_pos, -1]) | ||
| cube([usb_w, usb_h, front_thickness + this_cut_depth]); |
There was a problem hiding this comment.
The magic number -1 for Z-position is duplicated across all storage cut functions. Consider extracting this into a named constant (e.g., cut_z_offset = -1) to clarify its purpose and enable easier adjustment.
| translate([x_pos, center_y - sd_h/2, -1]) | ||
| cube([sd_w, sd_h, front_thickness + this_cut_depth]); |
There was a problem hiding this comment.
The magic number -1 for Z-position is duplicated across all storage cut functions. Consider extracting this into a named constant (e.g., cut_z_offset = -1) to clarify its purpose and enable easier adjustment.
| translate([x_pos, y_pos, -1]) | ||
| cube([msd_w, msd_h, front_thickness + this_cut_depth]); |
There was a problem hiding this comment.
The magic number -1 for Z-position is duplicated across all storage cut functions. Consider extracting this into a named constant (e.g., cut_z_offset = -1) to clarify its purpose and enable easier adjustment.
This pull request adds a configurable OpenSCAD script for generating a customizable USB/SD/microSD rack plate.
The new script introduces parameters for rack dimensions, slot arrangements, safety features, and structural elements, enabling flexible design for 3D printing or fabrication.
Test it out on the OpenSCAD Playground